package com.demo0;

/**
 * Colleague 具体的同事类  同事B
 * @author zhoujun
 * @date 2025/3/26 23:25
 */
public class ConcreteColleagueB  extends Colleague{

    private ConcreteColleagueA colleagueA;

    public void setColleagueB(ConcreteColleagueA colleagueA) {
        this.colleagueA = colleagueA;
    }

    @Override
    public void send(String message){
        System.out.println("同事B发送消息给同事A:" + message);
        colleagueA.receive(message);
    }

    @Override
    void receive(String message) {
        System.out.println("同事B收到消息=" + message);
    }
}
